#ifndef __RS485_H__
#define __RS485_H__
#include "usart.h"
#include "onewire.h"

/* User Config */
#define RS485_USART         huart2
#define RX485_DATA_LEN 15
/* RS485 TX/RX Control */
#define RS485_TX_ENABLE()   DWT_DelayMS(1);\
                            HAL_GPIO_WritePin(RS485_TR_GPIO_Port, RS485_TR_Pin, GPIO_PIN_SET);\
                            DWT_DelayMS(1);

#define RS485_RX_ENABLE()   DWT_DelayMS(1);\
                            HAL_GPIO_WritePin(RS485_TR_GPIO_Port, RS485_TR_Pin, GPIO_PIN_RESET);\
                            DWT_DelayMS(1);

void RS485_Init(void);
int RS485_Transmit(uint8_t *TxData, uint16_t len);
void RS485_printDataFrom485(uint8_t *data, uint16_t len);

 
#endif /* __RS485_H__ */
